// pages/appoint/appoint.js
const app = getApp()
const util = require('../../utils/util.js')
Page({

    /**
     * 页面的初始数据
     */
    data: {
        url: '',
        tempData: [{id: 1, name: '小明', cid: '肠道科', index: 0}, {id: 2, name: '小红', cid: '皮肤科', index: 0}, {
            id: 3,
            name: '小绿',
            cid: '皮肤科',
            index: 0
        }, {id: 4, name: '小钱', cid: '皮肤科', index: 0}],
    },
    toDetail: function (event) {
        var exid = event.currentTarget.dataset.exid;
        console.log("exid" + exid)
        wx.navigateTo({
            url: 'appoint-detail/appoint-detail?id=' + exid
        })
    },
    onShow() {
        this.data.name = wx.getStorageSync('name')
        var uid = wx.getStorageSync('id')
        console.log(uid + "------")
        util.http('/wx/doctor', resp => {
            console.log(resp.doctorBeans)
            this.data.tempData = resp.doctorBeans
            this.setData(this.data)
        })
    }
})